package com.atguigu.reflect;

public class Car {
    private String name;
    private double price;
    private int age;
    private String color;

    // 有参构造器
    public Car(String name, double price, int age, String color) {
        this.name = name;
        this.price = price;
        this.age = age;
        this.color = color;
    }

    // 无参构造器
    private Car() {
    }

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", age=" + age +
                ", color='" + color + '\'' +
                '}';
    }

    // 普通方法
    private void run() {
        System.out.println("汽车在跑...");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
